package com.aluka.nirvana.framework.datasource.configuration;

import com.aluka.nirvana.framework.datasource.model.DataSourceWrap;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 数据源公共配置
 * @author gongli
 * @since 2019/12/20
 */
@ConfigurationProperties(prefix = "nirvana.database")
@Data
public class DataSourceProperties {

    private Map<String, DataSourceWrap> datasource = new LinkedHashMap<>();

    /**
     * 是否启用Jpa 默认true
     */
    private Boolean jpaEnabled = true;
    /**
     * 是否启用Mybatis 默认true
     */
    private Boolean mybatisEnabled = true;
    /**
     * 是否使用注解切换数据源 默认false
     */
    private Boolean isAnnotation = false;
    /**
     * 是否使用密码加密策略 默认false
     */
    private Boolean isEncrypt = false;


}
